﻿using System;
using Reflector.CodeModel;

namespace CallGraphExtractor.CecilAdapter
{
    class Module : IModule
    {
        private Mono.Cecil.ModuleDefinition mModuleDefinition;

        public Module(Mono.Cecil.ModuleDefinition moduleDefinition, IAssembly assembly)
        {
            this.mModuleDefinition = moduleDefinition;
            pAssembly = assembly;
        }
        #region IModule Members

        private IAssembly pAssembly;
        public IAssembly Assembly
        {
            get { return pAssembly; }
            set { throw new NotSupportedException(); }
        }

        public IAssemblyReferenceCollection AssemblyReferences
        {
            get { return new AssemblyReferenceCollection(mModuleDefinition.AssemblyReferences); }
        }

        public int FileAlignment
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Location
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public IModuleReferenceCollection ModuleReferences
        {
            get { throw new NotImplementedException(); }
        }

        public bool Pe32Plus
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public bool Required32Bit
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string TargetRuntimeVersion
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public ITypeDeclarationCollection Types
        {
            get { return new TypeDeclarationCollection(mModuleDefinition.Types); }
        }

        public IUnmanagedResourceCollection UnmanagedResources
        {
            get { throw new NotImplementedException(); }
        }

        public Guid Version
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        #endregion

        #region IModuleReference Members

        public IModule Context
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public string Name
        {
            get
            {
                return mModuleDefinition.Name;
            }
            set
            {
                throw new NotSupportedException();
            }
        }

        public IModule Resolve()
        {
            throw new NotImplementedException();
        }

        #endregion

        #region IComparable Members

        public int CompareTo(object obj)
        {
            throw new NotImplementedException();
        }

        #endregion

        #region ICustomAttributeProvider Members

        public ICustomAttributeCollection Attributes
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}
